package com.seleniti.enpareja.controller.model.integration.database.domain;

import java.util.Date;

import javax.jdo.annotations.Column;
import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.jdo.annotations.Version;
import javax.jdo.annotations.VersionStrategy;
import javax.validation.constraints.NotNull;

import org.ioc.commons.domain.features.HasLabel;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
@Version(column = "version", strategy = VersionStrategy.VERSION_NUMBER, extensions = { @Extension(vendorName = "datanucleus", key = "field-name", value = "version") })
public class WorkShift {

	public enum Shift implements HasLabel{
		MORNING("Mañana"), EVENING("Tarde"), NIGHT("Noche"), SPLIT_SHIFT("De partido"), OFF("Descanso");
		
		private String label;

		private Shift(String label) {
			this.label = label;
		}
		
		@Override
		public String getLabel() {
			return label;
		}
	}

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
	private String workShiftId;

	@Column(allowsNull="false")
	@NotNull
	private Date date;

	@Column(allowsNull = "false")
	@NotNull
	private Couple couple;

	@Column
	private Shift shiftMember1;

	@Column
	private Shift shiftMember2;
	
	@Column
	private String commentsMember1;

	@Column
	private String commentsMember2;

	protected long version;

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Couple getCouple() {
		return couple;
	}

	public void setCouple(Couple couple) {
		this.couple = couple;
	}

	public String getWorkShiftId() {
		return workShiftId;
	}

	public void setWorkShiftId(String workShiftId) {
		this.workShiftId = workShiftId;
	}

	public Shift getShiftMember1() {
		return shiftMember1;
	}

	public void setShiftMember1(Shift shiftMember1) {
		this.shiftMember1 = shiftMember1;
	}

	public Shift getShiftMember2() {
		return shiftMember2;
	}

	public void setShiftMember2(Shift shiftMember2) {
		this.shiftMember2 = shiftMember2;
	}

	public String getCommentsMember1() {
		return commentsMember1;
	}

	public void setCommentsMember1(String commentsMember1) {
		this.commentsMember1 = commentsMember1;
	}

	public String getCommentsMember2() {
		return commentsMember2;
	}

	public void setCommentsMember2(String commentsMember2) {
		this.commentsMember2 = commentsMember2;
	}

}
